function KKB.Panel_NPCs( Panel )
	Panel_NPCs = Panel
	Panel_NPCs:SetSize(100, 400)
	Panel_NPCs:Clear(true)
	Panel_NPCs.contents = vgui.Create("DListLayout")
	Panel_NPCs.contents:Clear()
	
	KKB.NPCs_GroupList = vgui.Create( "DListView" )
	KKB.NPCs_GroupList:AddColumn( "User Group" )
	KKB.NPCs_GroupList:SetTall( 150 )
	KKB.NPCs_GroupList:SetMultiSelect( true )
	function KKB.NPCs_Reload_GroupList()
		KKB.NPCs_GroupList:Clear()
		for k,_ in pairs(KKB.UserGroups) do
			KKB.NPCs_GroupList:AddLine(k)
		end
	end
	KKB.NPCs_Reload_GroupList()
	Panel_NPCs:AddPanel(KKB.NPCs_GroupList)
	
	local AddGroupButton = vgui.Create( "DButton" )
	AddGroupButton:SetText( "Add Group(s) To Selected NPC" )
	AddGroupButton.DoClick = function( button )
		local TreeItem = Panel_NPCs.NPCTree:GetSelectedItem()
		if ( TreeItem != nil ) then
			local SelectedLines = KKB.NPCs_GroupList:GetSelected()
			if ( #SelectedLines > 0 ) then
				local NPC = TreeItem:GetText()
				local Groups = {}
				for _,v in pairs(SelectedLines) do
					local Group = v.Columns[1]:GetValue()
					if ( KKB.NPCRestrictions[NPC] == nil or not table.HasValue(KKB.NPCRestrictions[NPC].Groups, Group) ) then
						table.insert(Groups, Group)
					end
				end
				if ( #Groups > 0 ) then
					net.Start( "KKB_NPC_Add" )
					net.WriteTable( Groups )
					net.WriteString( NPC )
					net.SendToServer()
				end
			end
		end
	end
	Panel_NPCs:AddPanel(AddGroupButton)
	
	Panel_NPCs.NPCTree = vgui.Create( "DTree" )
	Panel_NPCs.NPCTree:SetPadding( 5 )
	Panel_NPCs.NPCTree:SetTall( 400 )
	local NPCName = nil
	local Categorys = {}
	for k,v in pairs(list.Get("NPC")) do
		local Category = v.Category or "Other"
		if ( Categorys[Category] == nil ) then
			local Group = Panel_NPCs.NPCTree:AddNode( Category )
			Group.DoClick = function( Item )
				Item:SetSelected( false )
			end
			Categorys[Category] = Group
		end
		local NPC = Categorys[Category]:AddNode( v.Class )
		NPC.DoClick = function( Item )
			Panel_NPCs.AllowedGroupList:Clear()
			NPCName = Item:GetText()
			if ( KKB.NPCRestrictions[NPCName] != nil ) then
				Panel_NPCs.PhysgunCheck:SetValue(KKB.NPCRestrictions[NPCName].Options.Physgun)
				Panel_NPCs.ToolgunCheck:SetValue(KKB.NPCRestrictions[NPCName].Options.Toolgun)
				Panel_NPCs.GravcannonCheck:SetValue(KKB.NPCRestrictions[NPCName].Options.Gravcannon)
				Panel_NPCs.UseCheck:SetValue(KKB.NPCRestrictions[NPCName].Options.Use)
				Panel_NPCs.DamageCheck:SetValue(KKB.NPCRestrictions[NPCName].Options.Damage)
				Panel_NPCs.AllowedGroupList:Clear()
				for _,v in pairs(KKB.NPCRestrictions[NPCName].Groups) do
					Panel_NPCs.AllowedGroupList:AddLine(v)
				end
			end
		end
	end
	Panel_NPCs:AddPanel(Panel_NPCs.NPCTree)
	
	Panel_NPCs.AllowedGroupList = vgui.Create( "DListView" )
	Panel_NPCs.AllowedGroupList:AddColumn( "Allowed User Group" )
	Panel_NPCs.AllowedGroupList:SetTall( 150 )
	Panel_NPCs.AllowedGroupList:SetMultiSelect( true )
	function KKB.NPCs_Reload_AllowedGroups()
		Panel_NPCs.AllowedGroupList:Clear()
		if ( NPCName != nil ) then
			for _,v in pairs(KKB.NPCRestrictions[NPCName].Groups) do
				Panel_NPCs.AllowedGroupList:AddLine(v)
			end
		end
	end
	Panel_NPCs:AddPanel(Panel_NPCs.AllowedGroupList)
	
	local RemoveGroupButton = vgui.Create( "DButton" )
	RemoveGroupButton:SetText( "Remove Group(s) From Selected NPC" )
	RemoveGroupButton.DoClick = function( button )
		local TreeItem = Panel_NPCs.NPCTree:GetSelectedItem()
		if ( TreeItem != nil ) then
			local SelectedLines = KKB.NPCs_GroupList:GetSelected()
			if ( #SelectedLines > 0 ) then
				local NPC = TreeItem:GetText()
				local Groups = {}
				for _,v in pairs(SelectedLines) do
					local Group = v.Columns[1]:GetValue()
					if ( KKB.NPCRestrictions[NPC] != nil and table.HasValue(KKB.NPCRestrictions[NPC].Groups, Group) ) then
						table.insert(Groups, Group)
					end
				end
				if ( #Groups > 0 ) then
					net.Start( "KKB_NPC_Delete" )
					net.WriteTable( Groups )
					net.WriteString( NPC )
					net.SendToServer()
				end
			end
		end
	end
	Panel_NPCs:AddPanel(RemoveGroupButton)
	
	Panel_NPCs.BlacklistCheck = vgui.Create("DCheckBoxLabel")
	Panel_NPCs.BlacklistCheck:SetText("Blacklist?")
	Panel_NPCs.BlacklistCheck:SetTextColor( Color(0, 0, 0, 255) )
	Panel_NPCs.BlacklistCheck:SetValue(KKB.Settings.NPCs.Blacklist)
	Panel_NPCs.BlacklistCheck.OnChange = function( _, fVal )
		if ( KKB.Settings.NPCs.Blacklist != fVal ) then
			net.Start( "KKB_Settings_Update" )
			net.WriteString( "NPCs" )
			net.WriteString( "Blacklist" )
			net.WriteUInt( KKB.BoolToInt(fVal), 32 )
			net.SendToServer()
		end
	end
	Panel_NPCs:AddPanel(Panel_NPCs.BlacklistCheck)
	Panel_NPCs:AddControl("Label", {Text = ""})
	
	Panel_NPCs.PhysgunCheck = vgui.Create("DCheckBoxLabel")
	Panel_NPCs.PhysgunCheck:SetText("Physgun")
	Panel_NPCs.PhysgunCheck:SetTextColor( Color(0, 0, 0, 255) )
	Panel_NPCs.PhysgunCheck.OnChange = function( _, fVal )
		local TreeItem = Panel_NPCs.NPCTree:GetSelectedItem()
		if ( TreeItem != nil ) then
			local NPC = TreeItem:GetText()
			if ( KKB.NPCRestrictions[NPC] != nil ) then
				if ( KKB.NPCRestrictions[NPC].Options.Physgun != fVal ) then
					net.Start( "KKB_NPC_Update" )
					net.WriteString( NPC )
					net.WriteString( "Physgun" )
					net.WriteUInt( KKB.BoolToInt(fVal), 32 )
					net.SendToServer()
				end
			end
		end
	end
	Panel_NPCs:AddControl("Label", {Text = "Determines What Can Interact With This NPC"})
	Panel_NPCs:AddPanel(Panel_NPCs.PhysgunCheck)
	
	Panel_NPCs.ToolgunCheck = vgui.Create("DCheckBoxLabel")
	Panel_NPCs.ToolgunCheck:SetText("Toolgun")
	Panel_NPCs.ToolgunCheck:SetTextColor( Color(0, 0, 0, 255) )
	Panel_NPCs.ToolgunCheck.OnChange = function( _, fVal )
		local TreeItem = Panel_NPCs.NPCTree:GetSelectedItem()
		if ( TreeItem != nil ) then
			local NPC = TreeItem:GetText()
			if ( KKB.NPCRestrictions[NPC] != nil ) then
				if ( KKB.NPCRestrictions[NPC].Options.Toolgun != fVal ) then
					net.Start( "KKB_NPC_Update" )
					net.WriteString( NPC )
					net.WriteString( "Toolgun" )
					net.WriteUInt( KKB.BoolToInt(fVal), 32 )
					net.SendToServer()
				end
			end
		end
	end
	Panel_NPCs:AddPanel(Panel_NPCs.ToolgunCheck)
	
	Panel_NPCs.GravcannonCheck = vgui.Create("DCheckBoxLabel")
	Panel_NPCs.GravcannonCheck:SetText("Gravcannon")
	Panel_NPCs.GravcannonCheck:SetTextColor( Color(0, 0, 0, 255) )
	Panel_NPCs.GravcannonCheck.OnChange = function( _, fVal )
		local TreeItem = Panel_NPCs.NPCTree:GetSelectedItem()
		if ( TreeItem != nil ) then
			local NPC = TreeItem:GetText()
			if ( KKB.NPCRestrictions[NPC] != nil ) then
				if ( KKB.NPCRestrictions[NPC].Options.Gravcannon != fVal ) then
					net.Start( "KKB_NPC_Update" )
					net.WriteString( NPC )
					net.WriteString( "Gravcannon" )
					net.WriteUInt( KKB.BoolToInt(fVal), 32 )
					net.SendToServer()
				end
			end
		end
	end
	Panel_NPCs:AddPanel(Panel_NPCs.GravcannonCheck)
	
	Panel_NPCs.UseCheck = vgui.Create("DCheckBoxLabel")
	Panel_NPCs.UseCheck:SetText("Use")
	Panel_NPCs.UseCheck:SetTextColor( Color(0, 0, 0, 255) )
	Panel_NPCs.UseCheck.OnChange = function( _, fVal )
		local TreeItem = Panel_NPCs.NPCTree:GetSelectedItem()
		if ( TreeItem != nil ) then
			local NPC = TreeItem:GetText()
			if ( KKB.NPCRestrictions[NPC] != nil ) then
				if ( KKB.NPCRestrictions[NPC].Options.Use != fVal ) then
					net.Start( "KKB_NPC_Update" )
					net.WriteString( NPC )
					net.WriteString( "Use" )
					net.WriteUInt( KKB.BoolToInt(fVal), 32 )
					net.SendToServer()
				end
			end
		end
	end
	Panel_NPCs:AddPanel(Panel_NPCs.UseCheck)
	
	Panel_NPCs.DamageCheck = vgui.Create("DCheckBoxLabel")
	Panel_NPCs.DamageCheck:SetText("Damage")
	Panel_NPCs.DamageCheck:SetTextColor( Color(0, 0, 0, 255) )
	Panel_NPCs.DamageCheck.OnChange = function( _, fVal )
		local TreeItem = Panel_NPCs.NPCTree:GetSelectedItem()
		if ( TreeItem != nil ) then
			local NPC = TreeItem:GetText()
			if ( KKB.NPCRestrictions[NPC] != nil ) then
				if ( KKB.NPCRestrictions[NPC].Options.Damage != fVal ) then
					net.Start( "KKB_NPC_Update" )
					net.WriteString( NPC )
					net.WriteString( "Damage" )
					net.WriteUInt( KKB.BoolToInt(fVal), 32 )
					net.SendToServer()
				end
			end
		end
	end
	Panel_NPCs:AddPanel(Panel_NPCs.DamageCheck)
end